package View;

/**
 * Classe responsavel pelo conteudo exibido no icone de itens.
 * DESIGN PATTERN STRATEGY
 * 
 * @author Edjane Catolle, Igor Henrique, Luiz Augusto, Vladmir Chicarolli
 * @version 1.0.0
 * @since 05/31/2011
 */

import java.awt.Point;
import Model.ImagesManager;
import Model.ItemBase;
import Model.ItemType;

public class ItemView extends BaseView
{
	private ItemType currentChoice;
	
	@Override
	public void DrawHandler()
	{	
		if(currentChoice != null)
		{
			switch (currentChoice) 
			{
				case QUESTIONITEM:
				 buffer = ImagesManager.LoadImage(ImagesManager.itemIcon);
				break;
				
				case SPEEDPLAYER:
				 buffer = ImagesManager.LoadImage(ImagesManager.playerSpeedIcon);
				break;
				
				case SLOWPLAYER:
				 buffer = ImagesManager.LoadImage(ImagesManager.playerSlowIcon);
				break;
				
				case SPEEDZOMBIE:
				 buffer = ImagesManager.LoadImage(ImagesManager.zombieSpeedIcon);
				break;
				
				case SLOWZOMBIE:
				 buffer = ImagesManager.LoadImage(ImagesManager.zombieSlowIcon);
				break;
				
				case DESTROYOBSTACLES:
				 buffer = ImagesManager.LoadImage(ImagesManager.playerPowerIcon);
				break;
				
			}
			
			Point p = ItemBase.ItemManager().GetTilePoint();
			if(p != null)
			{
				CustomImage(p);
				DrawBuffer();				
			}			
		}		
	}
		
	public void setItemState(ItemType state)
	{
		currentChoice = state;
	}		
}
